package com.xxl.job.admin.repository;

import com.xxl.job.admin.core.model.XxlJobRegistry;
import com.xxl.job.admin.dao.XxlJobRegistryDao;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public class XxlJobRegistryRepository implements XxlJobRegistryDao {

    private final XxlJobRegistryDao xxlJobRegistryDao;

    public XxlJobRegistryRepository(XxlJobRegistryDao xxlJobRegistryDao) {
        this.xxlJobRegistryDao = xxlJobRegistryDao;
    }


    @Override
    public List<Integer> findDead(Date deadTime) {
        return xxlJobRegistryDao.findDead(deadTime);
    }

    @Override
    public int removeDead(List<Integer> ids) {
        return xxlJobRegistryDao.removeDead(ids);
    }

    @Override
    public List<XxlJobRegistry> findAll(Date deadTime) {
        return xxlJobRegistryDao.findAll(deadTime);
    }

    @Override
    public int registryUpdate(String registryGroup, String registryKey, String registryValue, Date updateTime) {
        return xxlJobRegistryDao.registryUpdate(registryGroup, registryKey, registryValue, updateTime);
    }

    @Override
    public int registrySave(String registryGroup, String registryKey, String registryValue, Date updateTime) {
        return xxlJobRegistryDao.registrySave(registryGroup, registryKey, registryValue, updateTime);
    }

    @Override
    public int registryDelete(String registryGroup, String registryKey, String registryValue) {
        return xxlJobRegistryDao.registryDelete(registryGroup, registryKey, registryValue);
    }
}
